package com.fly.platform.base.pojo

import com.baomidou.mybatisplus.annotation.*
import com.fasterxml.jackson.annotation.JsonFormat
import com.fly.platform.common.constant.CommonConstant
import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty
import org.springframework.format.annotation.DateTimeFormat
import java.io.Serializable
import java.util.*

@ApiModel("基础实体")
open class BasePojo : Serializable {

    companion object {

        const val serialVersionUID: Long = 1L
    }

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("id", hidden = true)
    var id: String? = ""

    @ApiModelProperty("创建者")
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    var createBy: String? = ""

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(value = "update_by", fill = FieldFill.INSERT)
    var createTime: Date? = null


    @ApiModelProperty(value = "更新者", hidden = true)
    @TableField(value = "update_by", fill = FieldFill.UPDATE)
    var updateBy: String? = ""

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(value = "updateTime", fill = FieldFill.UPDATE)
    var updateTime: Date? = null

    @TableLogic
    @ApiModelProperty(value = "删除标志 默认0", hidden = true)
    @TableField(value = "del_flag")
    var delFlag:Int? = CommonConstant.STATUS_NORMAL
}